<#include "../../common/nolayout.ftl"/>
<@html css_=['life/user/user.css'] js_=['life/blog/blog.js']>
<body class="childrenBody">
<blockquote class="layui-elem-quote news_search">
    <form class="layui-form" id="listForm" action="${root}/m/blog/list" method="post">
        <input type="hidden" name="number" id="number" value="1"/>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input type="text" value="" placeholder="请输入用户昵称" name="username" class="layui-input search_input">
            </div>
            <div class="layui-input-inline">
                <input type="text" value="" placeholder="请输入博客标题" name="blogTitle" class="layui-input search_input">
            </div>
            <div class="layui-inline">
                <label class="">博客类型</label>
                <div class="layui-input-inline">
                    <select name="blogTypeId" style="color: #1acf74">
                        <option value="">全部</option>
                        <#if types??>
                            <#list types as type>
                              <option value="${type.id}">${type.name}</option>
                            </#list>
                        </#if>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="">是否审核</label>
                <div class="layui-input-inline">
                    <select name="type" style="color: #1acf74">
                        <option value="">全部</option>
                        <option value="0">已审核</option>
                        <option value="1">待审核</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="">是否开放</label>
                <div class="layui-input-inline">
                    <select name="openup" style="color: #1acf74">
                        <option value="">全部</option>
                        <option value="0">私密</option>
                        <option value="1">开放</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="">状态</label>
                <div class="layui-input-inline">
                    <select name="status" style="color: #1acf74">
                        <option value="">全部</option>
                        <option value="-1">删除</option>
                        <option value="0">系统下线</option>
                        <option value="1">正常</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="">是否推荐</label>
                <div class="layui-input-inline">
                    <select name="recommendType" style="color: #1acf74">
                        <option value="">全部</option>
                        <option value="0">推荐</option>
                        <option value="1">不推荐</option>
                    </select>
                </div>
            </div>
            <a class="layui-btn search_btn" lay-submit lay-filter="queryForm">查询</a>
        </div>
        <div class="layui-inline">
            <a class="layui-btn layui-btn-danger batchOff">批量下线</a>
        </div>
    </form>
</blockquote>
<div class="layui-form users_list">
    <table class="layui-table">
        <thead>
        <tr>
            <th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose" id="allChoose"></th>
            <th>用户头像</th>
            <th>登录名</th>
            <th>博客封面</th>
            <th>博客标题</th>
            <th>是否推荐</th>
            <th>是否开放</th>
            <th>状态</th>
            <th>审核状态</th>
            <th>创建时间</th>
            <th>更新时间</th>
            <th>统计数据</th>
        </tr>
        </thead>
        <tbody id="listDataBody"></tbody>
    </table>
</div>
<div  id="page"></div>
</body>


<script id="dataListTpl" type="text/html">
    {{#  if(d.list!=null&&d.list.length> 0){ }}
    {{#  layui.each(d.list, function(index, item){ }}
    <tr>
        <td><input type="checkbox" name="checked" lay-skin="primary" lay-filter="choose"></td>
        <td>
            {{# if(item.headimg){ }}
            <a><img src="{{item.headimg}}?imageView2/0/w/60/h/35" style="border-radius: 50%;"></a>
            {{#} else{ }}
            {{# } }}
        </td>
        <td><a href="http://lifes77.com/u/{{item.username}}" target="_blank">{{item.username||''}}</a></td>
        <td>
            {{# if(item.banner){ }}
            <a href="http://lifes77.com/blog/{{item.blogId}}" target="_blank"><img src="{{item.banner}}"></a>
            {{#} else{ }}
            {{# } }}
        </td>
        <td><a href="http://lifes77.com/blog/{{item.blogId}}" target="_blank">{{item.title.substring(0,8)}}</a></td>
        <td>
            <input type="checkbox" data-id="{{item.blogId}}" name="show" class="blogRecommendTypeFrozen" lay-skin="switch" lay-text="是|否" lay-filter="blogRecommendTypeFrozen"
                   {{# if(item.recommendType == 0){ }}checked="checked" {{# } }} />
        </td>
        <td>
            {{# if(item.openup=== 1){ }}
            开放
            {{#} else{ }}
            <span class="layui-bg-red">私密</span>
            {{# } }}
        </td>
        <td>
            {{# if(item.status=== 1){ }}
            正常
            {{#} else if(item.status==0){ }}
            系统下线
            {{#} else{ }}
            用户删除
            {{# } }}
        </td>
        <td>
            <input type="checkbox" data-id="{{item.blogId}}" name="show" class="blogFrozen" lay-skin="switch" lay-text="是|否" lay-filter="blogTypeFrozen"
                   {{# if(item.type == 0){ }}checked="checked" {{# } }} />
        </td>
        <td>{{ item.insertDate }}</td>
        <td>{{ layui.util.toDateString(item.loginTime, 'yyyy-MM-dd HH:mm:ss') }}</td>
        <td>阅读{{item.readCount}}/收藏{{item.collectCount}}/点赞{{item.praiseCount}}</td>
    </tr>
    {{#  }); }}
    {{#} else { }}
    <tr>
        <td colspan="11" style="text-align: center">无数据</td>
    <tr/>
    {{# }}}

</script>
</@html>